package com.testing.class5;

import com.testing.common.AutoTools;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * @Classname DateString
 * @Description 类型说明
 * @Date 2022/10/14 20:12
 * @Created by 特斯汀Roy
 */
public class DateString {
    public static String dateStr(String pattern) {
        SimpleDateFormat sdf=new SimpleDateFormat(pattern);
        String format = sdf.format(new Date());
        return format;
    }

    public static void main(String[] args) {
//        randomString("土匪","卡卡","茶悦","Peter");
        AutoTools.saveParam("老师","roy");
        AutoTools.saveParam("学员","茶悦，totoro");
        AutoTools.saveParam("学员2","砖头");

        String s="特斯汀学院有个{老师}，他为{学员}和{学员2}上课";
        String notNeedParam="特斯汀有好几位老师";
        String s1 = AutoTools.useParam(s);
        System.out.println(s1);
        String s2 = AutoTools.useParam(notNeedParam);
        System.out.println(s2);


    }

    public static void randomString(String... params) {
        //通过随机的下标取值
        Random random=new Random();
        int nextInt = random.nextInt(params.length);
        System.out.println(params[nextInt]);
    }


}
